<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8"/>
    <title>后台管理系统</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" href="/admin/css/style.css">
    <!--[if lt IE 9]>
    <script src="/admin/js/html5.js"></script>
    <![endif]-->
    <script src="/admin/js/jquery.js"></script>
    <script src="/admin/js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script>
        (function ($) {
            $(window).load(function () {

                $("a[rel='load-content']").click(function (e) {
                    e.preventDefault();
                    var url = $(this).attr("href");
                    $.get(url, function (data) {
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content 
                        $(".content").mCustomScrollbar("scrollTo", "h2:last");
                    });
                });

                $(".content").delegate("a[href='top']", "click", function (e) {
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo", $(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>

<body>
<!--header-->
<header>
    <div th:replace="admin/topBar::heater"></div>
</header>
<!--aside nav 开始-->

<aside class="lt_aside_nav content mCustomScrollbar">
    <div th:replace="admin/leftBar::left"></div>
</aside>
<!--aside nav结束-->
<section class="rt_wrap content mCustomScrollbar">
    <div class="rt_content">
        <div class="page_title">
            <h2 class="fl">会员列表</h2>
            <a href="user_detail.html" class="fr top_rt_btn add_icon">添加新会员</a>
        </div>
        <section class="mtb">
            <form action="/Users/Something" method="post">
                <label>
                    <select name="userState" class="select">
                        <option value="0">用户状态</option>
                        <option th:selected="${state == 1}" value="1">正常使用</option>
                        <option th:selected="${state == 2}" value="2">已封禁</option>
                    </select>
                </label>
                <label>
                    <input name="string" type="text" class="textbox textbox_225" placeholder="输入用户名查询..."/>
                </label>
                <input type="submit" value="查询" class="group_btn"/>
            </form>
        </section>
        <table class="table">
            <tr>
                <th>用户Id</th>
                <th>用户头像</th>
                <th>用户昵称</th>
                <th>收货地址</th>
                <th>账户余额</th>
                <th>操作</th>
            </tr>
            <tr th:each="alluser : ${allUser}">
                <td class="center" th:text="${alluser.userAccount}">001</td>
                <td class="center"><img th:src="'/Images' + ${alluser.userHead}" width="50" height="50"/></td>
                <td class="center" th:text="${alluser.userName}">DeathGhost</td>
                <td class="center" th:text="${alluser.userAddress}">成都职业技术学院</td>
                <td class="center">
                    <strong class="rmb_icon" th:text="${alluser.userMoney}">5559.00</strong>
                </td>
                <td class="center">
                    <section>
                        <form th:action="@{/Users/AddMoney(userAccount=${alluser.userAccount})}" method="post">
                            <input name="userMoney" type="number" class="textbox textbox_225"
                                   placeholder="手机号码... 增加金额">
                            <button type="submit" title="编辑" class="link_icon">&#118;</button>
                        </form>
                        <a th:if="${alluser.userState.userStateId==1}"
                           th:href="@{/Users/UpdateState(userAccount=${alluser.userAccount},userState=2)}" title="封禁"
                           class="link_icon">&#101;</a>
                        <a th:if="${alluser.userState.userStateId==2}"
                           th:href="@{/Users/UpdateState(userAccount=${alluser.userAccount},userState=1)}" title="解封"
                           class="link_icon">&#100;</a>
                    </section>
                </td>
            </tr>
        </table>

    </div>
</section>
</body>
<script>
    function add() {
        document.getElementById('').style.display = 'block';
        document.getElementById('').style.display = 'block';
    }
</script>

</html>